//
//  WeChatTieTableViewCell.m
//  ZYZB
//
//  Created by ENERGY on 2018/7/9.
//  Copyright © 2018年 ENERGY. All rights reserved.
//

#import "SettingContentTableViewCell.h"

@interface SettingContentTableViewCell()
@property (nonatomic, strong)UILabel * titleLab;
@property (nonatomic, strong)UIButton * arrowBtn;
@end
@implementation SettingContentTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        __weak typeof (self)weakSelf = self;
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.contentView.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:self.titleLab];
        [self.contentView addSubview:self.weChatLab];
        [self.contentView addSubview:self.arrowBtn];
        [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(weakSelf.contentView.mas_left).mas_offset(18/WIDTH_6_SCALE);
            make.top.equalTo(weakSelf.contentView.mas_top);
            make.bottom.equalTo(weakSelf.contentView.mas_bottom).mas_offset(-1/WIDTH_6_SCALE);
        }];
        [self.weChatLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.centerY.equalTo(weakSelf.titleLab);
            make.right.equalTo(weakSelf.arrowBtn.mas_left).mas_offset(-6/WIDTH_6_SCALE);
        }];
        [self.arrowBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(weakSelf.contentView.mas_right).mas_offset(-18/WIDTH_6_SCALE);
            make.centerY.equalTo(weakSelf.titleLab.mas_centerY);
            make.width.mas_offset(6/WIDTH_6_SCALE);
            make.height.mas_offset(12/WIDTH_6_SCALE);
        }];
        UIView * lineView = [[UIView alloc] init];
        lineView.backgroundColor = getColor(grayColor);
        [self.contentView addSubview:lineView];
        [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(weakSelf.contentView.mas_right).mas_offset(-18/WIDTH_6_SCALE);
            make.height.mas_offset(1/WIDTH_6_SCALE);
            make.bottom.equalTo(weakSelf.contentView.mas_bottom);
            make.left.equalTo(weakSelf.contentView.mas_left).mas_offset(18/WIDTH_6_SCALE);
        }];
        
    }return self;
}

- (UILabel *)titleLab{
    if (!_titleLab) {
        _titleLab = [[UILabel alloc] init];
        _titleLab.font = DEF_FontSize_14;
        _titleLab.textColor = [UIColor blackColor];
        _titleLab.textAlignment = NSTextAlignmentLeft;
        _titleLab.text = @"银行卡";
    }return _titleLab;
}
- (UILabel *)weChatLab{
    if (!_weChatLab) {
        _weChatLab = [[UILabel alloc] init];
        _weChatLab.font = DEF_FontSize_12;
//        [_weChatLab setTitle:@"去开户" forState:UIControlStateNormal];
        [_weChatLab setBackgroundColor:[UIColor clearColor]];
//        [_weChatLab setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];
    }
    return _weChatLab;
}
- (UIButton *)arrowBtn{
    if (!_arrowBtn) {
        _arrowBtn = [[UIButton alloc] init];
//        [_arrowBtn setBackgroundColor:[UIColor greenColor]];
        [_arrowBtn setImage:[UIImage imageNamed:@"in"] forState:UIControlStateNormal];
    }
    return _arrowBtn;
}
- (void)setModel:(NSDictionary *)model{
    _model = model;
    self.titleLab.text = model[@"title"];
//    [self.weChatLab setTitle:model[@"content"] forState:UIControlStateNormal];
    self.weChatLab.text = model[@"content"];
    self.weChatLab.textColor = [UIColor orangeColor];
}
- (void)setBlackModel:(NSDictionary *)blackModel{
    _blackModel = blackModel;
    self.titleLab.text = blackModel[@"title"];
//    [self.weChatLab setTitle:blackModel[@"content"] forState:UIControlStateNormal];
//    [self.weChatLab setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    self.weChatLab.text = blackModel[@"content"];
    self.weChatLab.textColor = [UIColor blackColor];
}
- (void)setBlueModel:(NSDictionary *)blueModel{
    _blackModel = blueModel;
    self.titleLab.text = blueModel[@"title"];
//    [self.weChatLab setTitle:blueModel[@"content"] forState:UIControlStateNormal];
//    [self.weChatLab setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    self.weChatLab.text = blueModel[@"content"];
    self.weChatLab.textColor = [UIColor blackColor];
}
@end
